
package com.fis.mca.persistence;

import java.io.Serializable;
import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;


/**
 * <p>Java class for tariffPlan complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="tariffPlan">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="chargeBand" type="{http://tariffplan.mca.fis.com/}chargeBand" minOccurs="0"/>
 *         &lt;element name="code" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="effectDate" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
 *         &lt;element name="expireDate" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
 *         &lt;element name="isCheckTimezone" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="isFree" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="mcaAction" type="{http://tariffplan.mca.fis.com/}mcaAction" minOccurs="0"/>
 *         &lt;element name="mcaPackage" type="{http://tariffplan.mca.fis.com/}mcaPackage" minOccurs="0"/>
 *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="tariffId" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "tariffPlan", propOrder = {
    "chargeBand",
    "code",
    "effectDate",
    "expireDate",
    "isCheckTimezone",
    "isFree",
    "mcaAction",
    "mcaPackage",
    "name",
    "tariffId"
})
public class TariffPlan implements Serializable {

    protected ChargeBand chargeBand;
    protected String code;
    @XmlSchemaType(name = "dateTime")
    protected Date effectDate;
    @XmlSchemaType(name = "dateTime")
    protected Date expireDate;
    protected String isCheckTimezone;
    protected String isFree;
    protected McaAction mcaAction;
    protected McaPackage mcaPackage;
    protected String name;
    protected int tariffId;

    /**
     * Gets the value of the chargeBand property.
     * 
     * @return
     *     possible object is
     *     {@link ChargeBand }
     *     
     */
    public ChargeBand getChargeBand() {
        return chargeBand;
    }

    /**
     * Sets the value of the chargeBand property.
     * 
     * @param value
     *     allowed object is
     *     {@link ChargeBand }
     *     
     */
    public void setChargeBand(ChargeBand value) {
        this.chargeBand = value;
    }

    /**
     * Gets the value of the code property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getCode() {
        return code;
    }

    /**
     * Sets the value of the code property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setCode(String value) {
        this.code = (value == null) ? value : value.toUpperCase().trim();
    }

    /**
     * Gets the value of the effectDate property.
     * 
     * @return
     *     possible object is
     *     {@link Date }
     *     
     */
    public Date getEffectDate() {
        return effectDate;
    }

    /**
     * Sets the value of the effectDate property.
     * 
     * @param value
     *     allowed object is
     *     {@link Date }
     *     
     */
    public void setEffectDate(Date value) {
        this.effectDate = value;
    }

    /**
     * Gets the value of the expireDate property.
     * 
     * @return
     *     possible object is
     *     {@link Date }
     *     
     */
    public Date getExpireDate() {
        return expireDate;
    }

    /**
     * Sets the value of the expireDate property.
     * 
     * @param value
     *     allowed object is
     *     {@link Date }
     *     
     */
    public void setExpireDate(Date value) {
        this.expireDate = value;
    }

    /**
     * Gets the value of the isCheckTimezone property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIsCheckTimezone() {
        return isCheckTimezone;
    }

    /**
     * Sets the value of the isCheckTimezone property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIsCheckTimezone(String value) {
        this.isCheckTimezone = (value == null) ? value : value.trim();
    }

    /**
     * Gets the value of the isFree property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIsFree() {
        return isFree;
    }

    /**
     * Sets the value of the isFree property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIsFree(String value) {
    	if ("1".equals(value) || "true".equalsIgnoreCase(value))
        {
        	this.isFree = "1";
        }
        else
        {
        	this.isFree = "0";
        }
    }

    /**
     * Gets the value of the mcaAction property.
     * 
     * @return
     *     possible object is
     *     {@link McaAction }
     *     
     */
    public McaAction getMcaAction() {
        return mcaAction;
    }

    /**
     * Sets the value of the mcaAction property.
     * 
     * @param value
     *     allowed object is
     *     {@link McaAction }
     *     
     */
    public void setMcaAction(McaAction value) {
        this.mcaAction = value;
    }

    /**
     * Gets the value of the mcaPackage property.
     * 
     * @return
     *     possible object is
     *     {@link McaPackage }
     *     
     */
    public McaPackage getMcaPackage() {
        return mcaPackage;
    }

    /**
     * Sets the value of the mcaPackage property.
     * 
     * @param value
     *     allowed object is
     *     {@link McaPackage }
     *     
     */
    public void setMcaPackage(McaPackage value) {
        this.mcaPackage = value;
    }

    /**
     * Gets the value of the name property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setName(String value) {
        this.name = value.trim();
    }

    /**
     * Gets the value of the tariffId property.
     * 
     */
    public int getTariffId() {
        return tariffId;
    }

    /**
     * Sets the value of the tariffId property.
     * 
     */
    public void setTariffId(int value) {
        this.tariffId = value;
    }
    
    @Override
    public String toString()
    {
    	return this.name;
    }
    
    public boolean equals(Object obj)
	{
		if (this == obj)
		{
			return true;
		}
		if ((obj == null) || (obj.getClass() != this.getClass()))
		{
			return false;
		}
		// object must be Test at this point
		TariffPlan tariffPlan = (TariffPlan) obj;
		return tariffId == tariffPlan.getTariffId();
	}
	


}
